import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
import store from "@/store";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
/*导入公共的css
 */
import "@/assets/style/common.css";
const app = createApp(App);


const userRole = store.state.user.roles;

app.directive("hasPermissions", {
  beforeMount(el, binding, vnode) {
    let usersPermissions=window.sessionStorage.getItem("permissions")
    // console.log(usersPermissions)
    if (!usersPermissions.includes(binding.value)) {
      //由于remove不知道为什么没用，只能迂回，
      //在需要权限控制的节点外,包一个标签
      el.removeChild(el.childNodes[0])

    }
  },
});

app.use(router).use(store).use(ElementPlus).mount("#app");
